import Mock from 'mockjs'
import React from 'react'
import './App.css'
import ListItem from './components/listItem'
const { list } = Mock.mock({
  "list|10": [{
    "id": "@id",
    "image": "@image(120x80, @color)",
    "title": "@ctitle",
    "desc": "@cword(10, 20)",
    "price|1-100": 1,
    "freight|2-10": 1,
    "sell|10-100000": 1,
    "city": "@city"
  }]
})

class App extends React.Component {
  state = {
    list: list
  }
  render() {
    const { list } = this.state
    return (
      <div>
          {
            list.map((v, i) => {
              return  <ListItem key={i} v={v}></ListItem>
            })
          }
      </div>  
    )
  }
}

export default App;
